class Solution
{
public:
    bool isPowerOfFour(int n)
    {
        return n > 0 && __builtin_popcount(n) == 1 && (n & 0x55555555);
    }
};